﻿using System;
using System.ServiceModel.Channels;
using OnlineGameLibrary.MessageEx;

namespace OnlineGameLibrary.ClientChannel
{
    public class MyAsyncResult : IAsyncResult
    {
        public MyAsyncResult(object state,MessageDefine define)
        {
            MessageDefine = define;
            AsyncState = state;
            IsCompleted = false;
        }

        public MessageDefine MessageDefine { set; get; }
        public MessageContent MessageContent { set; get; }

        public object AsyncState
        {
            get;
            private set;
        }

        public System.Threading.WaitHandle AsyncWaitHandle
        {
            get { throw new NotImplementedException(); }
        }

        public bool CompletedSynchronously
        {
            get { return false; }
        }

        public bool IsCompleted
        {
            set;
            get;
        }
    }

    public class AsyncPack
    {
        public AsyncPack(MyAsyncResult ar, AsyncCallback callback)
        {
            AsyncResult = ar;
            AsyncCallback = callback;
        }

        public MyAsyncResult AsyncResult { set; get; }
        public AsyncCallback AsyncCallback { set; get; }
    }
}
